﻿<Page
    x:Class="MediaPickerSample.MainPage"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MediaPickerSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

	<Grid x:Name="LayoutRoot" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,10">
			<TextBlock x:Name="ApplicationTitle" Text="Xamarin Mobile API Preview MediaPicker Sample" Style="{StaticResource HeaderTextStyle}"/>
			<TextBlock Text="{Binding State}" Style="{StaticResource BaselineTextStyle}" Margin="0,5,0,0" />
		</StackPanel>

		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="72" />
				<RowDefinition />
			</Grid.RowDefinitions>

			<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" >
				<Button Content="Pick Photo" Width="187" Command="{Binding PickPhoto}" />
				<Button Content="Take Photo" Width="187" Command="{Binding TakePhoto}" />
				<Button Content="Pick Video" Width="187" Command="{Binding PickVideo}" />
				<Button Content="Take Video" Width="187" Command="{Binding TakeVideo}" />
			</StackPanel>

			<Image Grid.Row="1" Name="image" Source="{Binding Image}" Visibility="{Binding PhotoVisibility}" />
			<StackPanel Grid.Row="1" Visibility="{Binding VideoPlayerVisibility}" Orientation="Vertical">
				<MediaElement Grid.Row="1" Name="video" AutoPlay="True" Width="1000" Height="500" />
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
					<Button Click="OnClickPlay">Play</Button>
					<Button Click="OnClickPause">Pause</Button>
					<Button Click="OnClickStop">Stop</Button>
				</StackPanel>
			</StackPanel>
		</Grid>
	</Grid>
</Page>
